package com.spring.springmvc.响应;

import jakarta.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@RequestMapping("setState")
@Controller
@ResponseBody
public class 设置状态码 {
    @RequestMapping("setState1")
    public String setState(HttpServletResponse response){
        response.setStatus(401);
        return "state-设置成功";
    }
}
